#include "spageservice.h"
#include "spageidentify.h"
#include <QImage>
#include <QThreadPool>

namespace onechchy
{
    SPageService::SPageService(QObject *parent) : QObject(parent)
    {
        mpPageIdentify = new SPageIdentify();
    }

    SPageService::~SPageService()
    {
        if (mpPageIdentify != nullptr)
        {
            delete mpPageIdentify;
        }
    }

    void SPageService::start(QString imageUrl)
    {
        QImage image(imageUrl.mid(8));
        int curPage = mpPageIdentify->identifyPage(image);

        emit this->end(curPage);
    }
}
